from yahoo.search.news import NewsSearch
from yahoo.search.web import WebSearch

app_id = "NQ0jPsbV34EKDAqvHpDPN2oQCfzKryHu4ryznZbHTJKrgScaqe1KmIORmufdUA--"

def testNewsSearch():
    srch = NewsSearch('YahooDemo', query='kittens')
    info = srch.parse_results()
    print info.total_results_available
    print info.total_results_returned
    print info.first_result_position
    for result in info.results:
        print "'%s', from %s" % (result['Title'], result['NewsSource'])

#NQ0jPsbV34EKDAqvHpDPN2oQCfzKryHu4ryznZbHTJKrgScaqe1KmIORmufdUA--
    
def testWebSearch():
    
    srch = WebSearch(app_id)
    srch.query = "gemekker"
    srch.results = 5
    results = srch.parse_results()
 
    for res in results:
        url = res.Url
        summary = res.Summary
        title = res.Title
        print title
        print summary
        print url

print "Hello Yahoo!"
testWebSearch()